package com.foeye.spring.chapter2.helloworld;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class TestHello {
	public static void main(String[] args) {
		//1.创建Spring的IOC容器对象
		//ApplicationContext 代表IOC容器
		//ClassPathXmlApplicationContext：是ApplicationContext实现类.该实现类从类路径下加载配置文件.
		ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-context.xml");
		//2.从IOC容器中获取Bean实例
		HelloApi helloWorld = (HelloApi) ctx.getBean("helloApi");
		//3.调用方法
		helloWorld.sayHello();
		
	}
	
	
}
